Unclamp noise velocity.#5266
Conversation
|
@chanhhoang99, your PR has failed to build. Please check CI outputs and resolve issues. |
There was a problem hiding this comment.
Please remove the commented out lines, I don't like keeping dead code inline :-)
Please also rebase on main so CI should turn over - there were some message filter API changes that are fixed in main now that should make this compile (minus any potential issues in this PR)
Also fix the linting error:
+++ nav2_mppi_controller/include/nav2_mppi_controller/motion_models.hpp.uncrustify
@@ -96,2 +96,2 @@
- .cwiseMax(lower_bound_vx)
- .cwiseMin(upper_bound_vx);
+ .cwiseMax(lower_bound_vx)
+ .cwiseMin(upper_bound_vx);
@@ -103,2 +103,2 @@
- .cwiseMax(state.wz.col(i - 1) - max_delta_wz)
- .cwiseMin(state.wz.col(i - 1) + max_delta_wz);
+ .cwiseMax(state.wz.col(i - 1) - max_delta_wz)
+ .cwiseMin(state.wz.col(i - 1) + max_delta_wz);
@@ -117,2 +117,2 @@
- .cwiseMax(lower_bound_vy)
- .cwiseMin(upper_bound_vy);
+ .cwiseMax(lower_bound_vy)
+ .cwiseMin(upper_bound_vy);
|
See my comment in huynhduc9905#6 (comment) |
87c7f34 to
781b790
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 7 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Your compiler warnings are odd - I just opened a PR that should address it #5277. I'll merge once CI passes in the morning and then you should rebase on it to get the Build Against Released Distributions" jobs to pass |
|
Merged - please rebase! I’m not sure what’s going on with mypy linting - feel free to ignore that for the scope of this PR if we get everything else passing. |
a038a8f to
c74adaa
Compare
|
@chanhhoang99 please sign off with DCO :-) That's the only thing blocking for merge other than asking others to validate since this is a major change (even though its like 3 changes 😆 ) |
Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
c74adaa to
c783bec
Compare
|
Just waiting on testing BTW! |
|
I'm having a hard time finding beta testers with similar situations that aren't too underwater to test this. I'm going to go ahead and merge this after some preliminary testing done be 2-3 people and didn't notice an issue. I'll just keep a look out on the issue tracker if there are any regressions reported. Thanks for this contribution @chanhhoang99 ! |
|
@chanhhoang99 should we keep chatting about the lag compensation piece? |
|
@SteveMacenski , I have not yet make progress on that. I will create another issue when there is improvement. |
|
Great thanks for the update! Let me know if I can be of help! I really appreciate you digging into MPPI, not many folks have given me critical feedback on the internal functioning to date (only that they like the outputs) |
* unclamp state.cvx Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * remove uncommented code Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * fix linting Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * fix wrong linting Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> --------- Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
* unclamp state.cvx Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * remove uncommented code Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * fix linting Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> * fix wrong linting Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com> --------- Signed-off-by: Chanh Hoang <chanhhoang999x@gmail.com>
|
For me these changes are breaking; the acceleration limits are no longer respected: before this PR
after this PR
I'm not too familiar with this part to debug, can you guys see an issue with it? I created #5464 to track |
This reverts commit fb25b2f.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit fb25b2f.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
This reverts commit 52a4315.
|
@chanhhoang99 note that I'm currently thinking about this again on a related topic and I as before think that this is correct (though had to revert since it broke people). On some analysis, I think the issue with the wobbling is due to the control sequence being based on the unsmoothed The reason that Open Loop odometry seemed to work is since any error / lag in execution is going to amplify the issues, but I don't think that actually solves the core issue at play. Thus I think the answer is to spend some time on improving the pipeline so that this is more stable with different sampling distributions/spaces and/or post-processing. I have ideas but so far nothing tested to give you concrete ideas. |
|
Check out my notes / progress here: https://github.com/ros-navigation/navigation2/blob/low_accel/low_accel_notes.md I'm curious on your thoughts, but I think that the open-loop solution is actually a hack that really shouldn't work, but it makes the problem less amplified. I've found the actual no-kidding solution. The next step I need to do is improve MPPI's smoothness to make sure that this is all a net-positive for all users (though it probably already is). I do not see the wobble issue that you report, but it is very likely a manifestation of some other issues I had to resolve to get the open-loop / closed-loop to work properly with acceleration handling at Please take a look and let me know. Sorry about the delay, I can't always personally jump in at the time when users file issues :( I am doing so now and really digging into it. |
|
@SteveMacenski Do you still have emails that I sent you which have video recordings/yaml file when I was testing with various accel, model_dt, ... changes ? I think they could help understand situation a little bit. |
|
I can't seem to find it, can you forward it back to me again? If there's any color you can give me with the context of my current work (things to check/test) that would be appreciated |
|
Fowarded |
|
I think this sums up well a few things I also noticed. In particular:
I also tested it a bit in sim, though it is still WIP, right?
For comparison, without your changes: For refernce, an extract of my config |
|
Thanks for the feedback - what about pulling in the changes of #6066 to that branch, does that solve your "snaking" issue? I think that's probably due to a delay in the system which this could model. Using your plots, find the dt between the odom and the cmd_vel, then put that in the model delay parameter. Try again with open vs closed loop :-) I personally hope that open loop is just totally unnecessary to get good behavior. I would leave it in place (some rare applications have no odometry at all), but my aim would be to have something that uses your real data to make sure you're physically grounded. You're only seeing that behavior with low accelerations, correct? |
|
@adivardi @SteveMacenski , As I remember correcly, if applying this PR, user have to make there base controller (motor driver controller) to have control cmd clamp(which sent by nav2 stack) with exact acceleration clamp in the MPPI in the driver. Read the "Description of how this change was tested" in this PR could tell. |
|
The version in my branch is different; the acceleration limits are applied in the refinement of the optimal trajectory 🙂 |
oh nice, I wasn't aware of it. We have also been working on something similar since our robot has a really high delay. I tried it out. It improves the oscillations but still oscillates a lot more than with the open_loop. That being said, it also improves the performance with open_loop, so a good addition regardless of the open_loop choice.
I haven't tried again with your low_acceleration branch, since I see you are still working on it. |
|
The low acceleration branch is now done and ready for testing! |
|
And with open-loop these are removed in either/both cases? It sounds like in your application its worth sticking with that one then. I'm curious if you have any ideas why that is or something I can do to improve it? It seems to me maybe its due to noisy odometry -- else I"m not sure what else is the difference between open and closed loop. The two contributors that come to my mind are (1) delay (which we've modeled) and (2) noise (which we haven't). |
No, it happens once I add the I tried keeping all your other changes, but clamping the raw controls ( |
|
I have no earthly idea either, I can't reproduce it. Do you you see it running in the turtlebot sim in nav2_bringup? If not, then maybe you can highlight some of the changes you have in your simulator (use the diff drive plugin, modeled delay or anything else?) which may be able to narrow down to some way I can reproduce and debug. Push comes to shove, I can parameterize whether to clamp the controls so you can still get that behavior, but I would like to be able to reproduce and understand why (and hopefully fix) rather than introducing yet another variable and not having very clear documentation about who should use it when/why. |






Basic Info
Description of contribution in a few bullet points
Verify acceleration constrain applied to noise velocity sample.
Description of documentation updates required from your changes
Description of how this change was tested
Tested with robot base which has acceleration clamp in driver controller and verify if robot MPPI controller can predict that acceleration clamp or not.(Tested with low acceleration e.g az = 0.1 rad/s^2, ax max = 0.5 m/s^2, ax min = -0.5m/s^2)
Future work that may be required in bullet points
For Maintainers: